#include "QMoveFaceOperation.h"

#include "Core/MainWindow.h"

QMoveFaceOperation::QMoveFaceOperation(MainWindow* inMainWindow, ShapeOperation* inOperation, QWidget* parent)
	: QRSWidgetBase(inMainWindow, inOperation, parent)
	, ui(new Ui::QMoveFaceOperationClass())
{
	ui->setupUi(this);

	m_mainWindow->SetCanMultiSelect(false);

	connect(ui->modifyButton, &QPushButton::clicked, this, &QMoveFaceOperation::OnModify);
	connect(ui->confirmButton, &QPushButton::clicked, this, &QMoveFaceOperation::OnConfirm);
	connect(ui->cancelButton, &QPushButton::clicked, this, &QMoveFaceOperation::close);

	connect(m_mainWindow, &MainWindow::OnSelectedSubShapes, this, &QMoveFaceOperation::OnSelectedSubShapes);
	connect(ui->dirCombo, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &QMoveFaceOperation::OnTargetComboIndexChange);

	m_mainWindow->SetSelectionMode(SM_Face);

	m_dir = new RWTripleFloatInput(ui->dirX, ui->dirY, ui->dirZ);
}

QMoveFaceOperation::~QMoveFaceOperation()
{
	delete ui;
	delete m_dir;
}

void QMoveFaceOperation::OnSelectedSubShapes(QIVtkSelectionPipeline* actor)
{
}

void QMoveFaceOperation::closeEvent(QCloseEvent* event)
{
	disconnect(m_mainWindow, &MainWindow::OnSelectedSubShapes, this, &QMoveFaceOperation::OnSelectedSubShapes);

	m_mainWindow->SubWidgetClose(bIsConfirmed);
	m_mainWindow->SetCanMultiSelect(true);
}

void QMoveFaceOperation::OnTargetComboIndexChange(int index)
{
}

void QMoveFaceOperation::OnModify()
{
}

void QMoveFaceOperation::OnConfirm()
{
}

void QMoveFaceOperation::MoveFaceInner()
{
}
